#pragma config(Hubs,  S1, HTMotor,  none,     none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Motor,  motorA,           ,             tmotorNXT, openLoop, encoder)
#pragma config(Motor,  motorB,           ,             tmotorNXT, openLoop, encoder)
#pragma config(Motor,  mtr_S1_C1_1,     left,          tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C1_2,     right,         tmotorTetrix, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//
#define PARALLEL_PAIRS

//#pragma debuggerWindows("nxtLCDScreen");
//#pragma debuggerWindows("Servos");
#pragma debuggerWindows("joystickGame");

#include "JoystickDriver.c"
#include "../library/controllers/tank_controller.c"
#include "../library/controllers/arcade_controller.c"

task main()
{
	waitForStart();
	RegisterDriveMotorPair(left, right);
	RegisterReverseButton(1);

	StartTask(DriveTank);

	bool tankMode = true;

	while(true)
	{
		if(joy1Btn(10) == 1) // start button
		{
			StopTask(DriveTank);
			StopTask(DriveArcade);
			while(joy1Btn(10) == 1)
			{
			}
			if(tankMode == true)
			{
				StartTask(DriveArcade);
				tankMode = false;
			}
			else
			{
				StartTask(DriveTank);
				tankMode = true;
			}
		}
	}
}
